package cn.fintecher.pangolin.entity.elastic;

import cn.fintecher.pangolin.common.enums.ImportDataExcelStatus;
import cn.fintecher.pangolin.common.enums.ImportTemplateType;
import cn.fintecher.pangolin.common.utils.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
import java.util.List;

/**
 * @Auther: xiaqun
 * @Description: 数据导入记录
 * @Date: 16:57 2019/8/26
 */

@Data
@Document(indexName = Constants.DATA_IMPORT_RECORD, type = Constants.DATA_IMPORT_RECORD, shards = 1, replicas = 0)
@ApiModel(value = "数据导入记录", description = "数据导入记录")
public class DataImportRecord {
    @Id
    @ApiModelProperty(value = "主键ID")
    private String id;

    @ApiModelProperty(value = "批次号")
    private String batchNumber;

    @ApiModelProperty(value = "委托方ID")
    private String principalId;

    @ApiModelProperty(value = "委托方名称")
    private String principalName;

    @ApiModelProperty(value = "案件数量")
    private Integer totalNumber;

    @ApiModelProperty(value = "导入状态")
    private ImportDataExcelStatus status;

    @ApiModelProperty(value = "导入类型")
    private ImportTemplateType type;

    @ApiModelProperty(value = "错误文件ID")
    private String fileId;

    @ApiModelProperty(value = "操作人")
    private String operator;

    @ApiModelProperty(value = "操作时间")
    private Date operateTime;

    public void process(String name, Date date) {
        this.operator = name;
        this.operateTime = date;
    }
}
